home *** CD-ROM | disk | FTP | other *** search
/ Virtual Sex Shoot / Virtual Sex Shoot.iso / mac / Virtual Sex Shoot / Virtual Sex Shoot.DXR / 00128.ls < prev    next >
Encoding:
Text File  |  1995-09-24  |  6.6 KB  |  191 lines

  1. global gMovie1TimeCodes, gMovie2TimeCodes, gMovie3TimeCodes, gMovie4TimeCodes, gMarkerSlots, gFrames, gLabels, gPreviousTime, gStoredTime, gWhichMovie, gWhichClip, gSliderPositions, gMovieSprite, gStartTime, gStopTime, gBDrop, gVR, gFullScreen, gWhichCamera, gSliderCorrelation, gSliderCorrelationCount, gFloatingSprite, gAutomated, gAutomatedTimes, gWhichAutomatedClip, gRecording, gPlaying, gSliderSprite, gMarkers, gMinH, gMaxH
  2.  
  3. on setProp startSprite, endSprite, whichProperty, whichValue
  4.   repeat with x = startSprite to endSprite
  5.     do("set the " & whichProperty & " of sprite x=" & whichValue)
  6.   end repeat
  7. end
  8.  
  9. on QT whichSprite
  10.   if the type of sprite whichSprite > 0 then
  11.     if the castType of cast the castNum of sprite whichSprite = #digitalVideo then
  12.       return 1
  13.       exit
  14.     end if
  15.   end if
  16.   return 0
  17. end
  18.  
  19. on stopAllQT
  20.   repeat with x = 1 to 48
  21.     if the type of sprite x > 0 then
  22.       set whichCast to the castNum of sprite x
  23.       if whichCast > 0 then
  24.         if the castType of cast whichCast = #digitalVideo then
  25.           set the movieRate of sprite x to 0
  26.         end if
  27.       end if
  28.     end if
  29.   end repeat
  30.   updateStage()
  31. end
  32.  
  33. on highlightSelection
  34.   setProp(18, 21, "puppet", 0)
  35.   setProp(24, 29, "puppet", 0)
  36.   swapPlaybackScreen("playback dot")
  37.   set whichSprite to 17 + gWhichMovie
  38.   puppetSprite(whichSprite, 1)
  39.   set the ink of sprite whichSprite to 4
  40.   set whichSprite to 23 + gWhichClip
  41.   puppetSprite(whichSprite, 1)
  42.   set the ink of sprite whichSprite to 4
  43.   updateStage()
  44. end
  45.  
  46. on correlateSliderPositionsToMovieTime
  47.   if listp(gAutomatedTimes) = 0 then
  48.     exit
  49.   end if
  50.   set theCount to count(gAutomatedTimes)
  51.   if theCount = 0 then
  52.     exit
  53.   end if
  54.   set gSliderCorrelation to []
  55.   set gSliderPositions to []
  56.   set lTotalDuration to 0
  57.   repeat with x = 1 to theCount
  58.     set timeCodeX to getAt(gAutomatedTimes, x)
  59.     if listp(timeCodeX) then
  60.       set lWhichMovie to getAt(timeCodeX, 1)
  61.       set lWhichClip to getAt(timeCodeX, 2)
  62.       set numberOfClips to 0
  63.       do("set numberOfClips=value ( count ( gMovie" & lWhichMovie & "TimeCodes ))")
  64.       set lWhichClip to checkRange(lWhichClip, 1, numberOfClips)
  65.       set lWhichCamera to getAt(timeCodeX, 3)
  66.       set lStartTime to getAt(timeCodeX, 4)
  67.       set lStopTime to getAt(timeCodeX, 5)
  68.       repeat with MovieFrame = lStartTime to lStopTime
  69.         append(gSliderCorrelation, [lWhichMovie, lWhichClip, lWhichCamera, MovieFrame, x])
  70.         set MovieFrame to MovieFrame + 5
  71.       end repeat
  72.       set lDuration to lStopTime - lStartTime
  73.       setAt(gSliderPositions, x, lDuration)
  74.       set lTotalDuration to lTotalDuration + lDuration
  75.     end if
  76.   end repeat
  77.   set gSliderCorrelationCount to count(gSliderCorrelation)
  78.   set minH to 0
  79.   set maxH to 0
  80.   set lMinH to 133
  81.   set lMaxH to 333
  82.   set sliderLength to lMaxH - lMinH
  83.   if lTotalDuration < 1 then
  84.     set lTotalDuration to 1
  85.   end if
  86.   set newCount to count(gSliderPositions)
  87.   repeat with x = 1 to newCount
  88.     set whichCodesX to getAt(gAutomatedTimes, x)
  89.     if listp(whichCodesX) then
  90.       set clipDuration to getAt(gSliderPositions, x)
  91.       set thePercentage to clipDuration * 1.0 / lTotalDuration * sliderLength
  92.       set maxH to integer(minH + thePercentage)
  93.       set maxSlider to sliderLength - (theCount - x)
  94.       if minH > maxSlider then
  95.         set minH to maxSlider
  96.       end if
  97.       if maxH > maxSlider then
  98.         set maxH to maxSlider
  99.       end if
  100.       setAt(whichCodesX, 6, minH + lMinH)
  101.       setAt(whichCodesX, 7, maxH + lMinH)
  102.       setAt(gAutomatedTimes, x, whichCodesX)
  103.       set minH to maxH + 1
  104.     end if
  105.   end repeat
  106. end
  107.  
  108. on getMarkerName
  109.   return getaProp(gFrames, marker(0))
  110. end
  111.  
  112. on getMarkerFrame whichLabel
  113.   return getaProp(gLabels, whichLabel)
  114. end
  115.  
  116. on initMarkerList
  117.   set theLabelList to the labelList
  118.   set gMarkerSlots to [:]
  119.   repeat with x = 1 to the number of lines in theLabelList
  120.     set labelX to label(x)
  121.     set stringX to string(line x of theLabelList)
  122.     do("addProp gFrames, #" & labelX & ", stringX")
  123.     do("addProp gLabels, #" & stringX & ", labelX")
  124.   end repeat
  125. end
  126.  
  127. on createLabelGlobals
  128.   set theLabelList to the labelList
  129.   set newGlobalScript to EMPTY
  130.   set newSetGlobalScript to EMPTY
  131.   repeat with x = 1 to the number of lines in theLabelList - 1
  132.     set lineX to line x of theLabelList
  133.     if lineX <> EMPTY then
  134.       set newGlobal to "f"
  135.       repeat with y = 1 to the number of words in lineX
  136.         set newGlobal to newGlobal & word y of lineX
  137.       end repeat
  138.       if newGlobal <> EMPTY then
  139.         repeat with y = 1 to the number of chars in newGlobal
  140.           set charY to char y of newGlobal
  141.           if charY = EMPTY then
  142.             exit repeat
  143.           end if
  144.           if charY >= "A" then
  145.             if charY <= "Z" then
  146.               next repeat
  147.             end if
  148.           end if
  149.           if charY >= "0" then
  150.             if charY <= "9" then
  151.               next repeat
  152.             end if
  153.           end if
  154.           if charY = "." then
  155.             next repeat
  156.           end if
  157.           delete char y of newGlobal
  158.           set y to y - 1
  159.         end repeat
  160.         if newGlobal <> EMPTY then
  161.           set globalAlreadyInUse to 0
  162.           repeat with y = 1 to the number of items in newGlobalScript
  163.             if newGlobal = item y of newGlobalScript then
  164.               set globalAlreadyInUse to 1
  165.               exit repeat
  166.             end if
  167.           end repeat
  168.           if globalAlreadyInUse = 0 then
  169.             set newGlobalScript to newGlobalScript & newGlobal & ","
  170.             set newSetGlobalScript to newSetGlobalScript & RETURN & "  set " & newGlobal & "=label (" & QUOTE & lineX & QUOTE & ")"
  171.           end if
  172.         end if
  173.       end if
  174.     end if
  175.   end repeat
  176.   set newGlobalScript to char 1 to the number of chars in newGlobalScript - 1 of newGlobalScript
  177.   set newScript to RETURN & RETURN & "on setLabelGlobals" & newSetGlobalScript & RETURN & "end" & RETURN & RETURN
  178.   set newScript2 to "on advanceFrame whichFrame" & RETURN & "  do (" & QUOTE & "go frame " & QUOTE & "& whichFrame )" & RETURN & "end"
  179.   set the scriptText of cast the number of cast "setLabelGlobals" to "global " & newGlobalScript & newScript & newScript2
  180. end
  181.  
  182. on checkCodes
  183.   set gMovie1TimeCodes to [[0, 8420], [8486, 16899], [16965, 22970], [23036, 29037], [29103, 35303], [35369, 41559], [41625, 47781], [47848, 54008], [54074, 58210], [58276, 62415], [62481, 65395], [65471, 68376]]
  184.   repeat with x = 1 to count(gMovie1TimeCodes)
  185.     set timeCodesX to getAt(gMovie1TimeCodes, x)
  186.     set startTimeCode to value(getAt(timeCodesX, 1))
  187.     set stopTimeCode to value(getAt(timeCodesX, 2))
  188.     put x & ". startTime: " & startTimeCode & " stopTime: " & stopTimeCode & " duration: " & stopTimeCode - startTimeCode
  189.   end repeat
  190. end
  191.